In an environment 100a of FIG. 1a, a personal computer (PC) 122 is being operated by a person 110 who is watching a video display on a monitor 102C. By way of example, person 110 can be watching a motion picture (movie) on monitor 102C, where the movie has a six (6) channel sound track in a Dolby® 5.1 format, and where PC 122 has Digital Video Disc (DVD) playback device in an A-V section 120 to playback the movie. PC 122 is executing an audio visual application to playback the movie on a DVD. By way of example, the audio visual application can be the Windows® Media Player software as provided by the Microsoft Corporation, of Redmond, Wash., USA.
An operating system (O/S) 114 of PC 122 recognizes the A-V section 120 that passes audio and video data to an input (IN) section 118. IN section 118 passes the audio and video data to a video system service of an operating system 114. The video system service of operating system 114 passes video data to a video driver 102A that drives a video card 102B. Video card 102B in turn outputs video signals of the movie to monitor 102C.
O/S 114 also recognizes a stereo sound card 104B. The stereo sound card 104B can be an expansion board mounted on a mother board that enables PC 122 to render stereo sound to the right and left speakers 106D, 108D by translating digital data into analog sounds. Stereo sound card 104B can be used to render (playback) or capture (record) audio data. For instance, stereo sound card 104B can be used to record sound input from a microphone connected to the PC 122, such as a microphone 535 seen in FIG. 5, and can be used to manipulate sound stored on a disk. The stereo sound card 104B can produce only two (2) channels of sound, rather than the six (6) channels of sound of the sound track of the movie on the DVD.
Person 110 sees the movie and hears the stereo sound through operation of the O/S 114 that includes an audio services component 116. The audio services component 116 includes an audio source, an audio buffer, and various software components. The O/S 114 of PC 122 uses a system timer (not shown) to periodically wake up the audio services component 116 for a period of time called a wake up period. During the wake up period, the audio services component 116 generates audio data that flows from the audio source within the audio services component 116. The audio data in the audio source can be moved to the audio buffer that is also within the audio services component 116. Sound card 104B is driven by a sound driver 104A to receive audio data from the audio buffer or to output audio data to the audio buffer.
When an audio device, such as sound card 104B, is used to render sound, each time the audio services component 116 wake ups, a query is made as to whether there is enough audio data in the audio buffer for the audio device. If there is enough audio data in the audio buffer for the audio device, a delay in the production of sound will be avoided before the start of the next wake up period. If there is too little data in the audio buffer for the audio device, then the audio services component 116 generates more data and puts that data down into the audio buffer for the audio device. In this situation, there will be an excess delay (e.g., latency) in the production of sound. For example, the audio services component 116 may be configured to generate a certain quantity of audio data during a wake up period having a duration of 10 milliseconds (ms). The audio services component 116 may also be configured to keep three times this quantity in the audio buffer for the audio device. As such, the audio services component 116 will maintain the quantity of audio data in the audio buffer to be that quantity that can be generated during three wake up periods of 10 milliseconds (e.g., 3-10 ms ‘buffers’). When the audio services component 116 wakes up, a query is made to see how many 10 ms buffers are stored in the audio buffer for the audio device. Fewer 10 ms buffers in the audio buffer means that the audio device has consumed more audio data than a norm. If the query finds that 2-10 ms buffers have been consumed by the audio device from the audio buffer, then the audio services component 116 generates 2 more 10 ms buffers of data and then sends that audio data down to the audio buffer for the audio device so that there will be 3-10 ms buffers in the audio buffer. If the audio services component 116 wakes up, the audio buffer quantity query is conducted, and the query finds that only 1-10 ms buffer has been consumed by the audio device, and then the audio services component 116 generates 2-10 ms buffers and sends them to the audio buffer. If the audio services component 116 wakes up and finds no audio data in the audio buffer (e.g., all 3-10 ms buffers were consumed by the audio device from the audio buffer), there would be excessive latency in the audio data being rendered by the audio device. Alternatively, a different problem can be realized when there is an excess of audio data in the audio buffer. This excess causes an ‘audio latency glitch’ that is characterized by a timing delay between when sound is suppose to be rendered and when the sound it is actually rendered.
The audio services component 116 can also cooperate with the audio device so that the audio device can be used to capture (record) audio data and store the audio data in the audio buffer. For example, an audio device such as sound card 104B can be used to capture sound where the sound card 104B receives audio data from a microphone. The microphone can be used by an operator of the PC in a real time communication application (RTC) for PC telephony. During the execution of the RTC, an operator speaks into the microphone and the operator's voice is captured using the capturing audio device (e.g., one or more sound cards), typically at a rate of 8 kHz (8000 samples/second). In this scenario, the audio services component 116 may be configured to wake up 100 times per second. So, during each wake up period, the audio services component 116 is processing 80 samples each time that the audio services component 116 wakes up. Stated otherwise, 80 samples are processed by the audio services component 116 during each 10 ms wake up period. An audio latency glitch can occur when the clock of the audio device is running faster than a clock of a system timer that runs the scheduling of the wake up period of the audio services component 116. As such, the faster audio device is actually generating more than 80 samples every 10 ms wake up period. Over time, the generated samples will accumulate until the audio buffer will not have read enough samples from the audio device. As such, the audio device will overwrite its own audio buffer and there will be an ‘audio overwriting glitch’. Stated otherwise, an audio overwriting glitch occurs where the audio device is generating audio data too fast to be put into the audio buffer for the audio device such that samples will be lost. When the audio data is rendered, the audio overwriting glitch will result in a popping or clicking sound. Each audio overwriting glitch causes the recorded or captured sound to differ from the actual sound that was intended to be recorded.
Another type of audio glitch occurs when the clock of the capturing audio device is running slower than the clock of the system timer that runs the scheduling of the wake up period of the audio services component 116. Here, dropped audio samples can occur because the capturing audio device is generating audio data too slowly. When the captured audio data is rendered, a clicking sound will be heard.
Still another audio glitch can occur when the audio services component 116 is reading audio data from its audio buffer for the capturing audio device too fast such that there is not enough audio data in the audio buffer. Here, the rendering of the captured audio data will result in gaps of silence, a broken up sound, or silence occurring in between samples of sound.
In sum, the types of problems in the production of sound that arise depend upon whether the audio device is running faster or slower than the clock of the system timer that is being used to run the software processing of the audio services component 116. A typical and noticeable problem is an excessive delay between when sound is supposed to be rendered and when the sound it is actually rendered. Accordingly, it would be an advantage in the art to provide implementations for rendering and capturing audio data with an audio device while avoiding the foregoing problems associated with the production of sound.
Sound and video, such as music and audio visual productions, are increasing being marketed in formats that are more sophisticated that two channel stereo. For example, six channel sound productions accommodate sound fields that have a right front channel, a left front channel, a right rear channel, a left rear channel, a center channel, and a bass channel. One example of a six channel sound production is a movie that has a sound track with audio data in a Dolby® 5.1 format, where the movie is embodied on portable media having a magneto optics format (e.g., DVD).
Computing systems, such as PC 122, are increasingly being used for recording and playing back streaming audio. A PC typically has an integrated sound card that is mounted on the mother board of the PC. The integrated sound card can typically process only two channels (e.g., stereo) of sound. In order to process a six channel sound production with a PC, expensive hardware is required. It would be an advantage in the art to provide an operating system for a PC that would enable the PC to play back a sound production having more than two channels without requiring expensive audio hardware.
PCs typically are arranged to communicate with one or more hardware devices through a bus that receives one or more printed circuit boards respectively associated with the hardware devices. The bus interfaces the plurality of printed circuit boards with the mother board of the PC. Examples of printed circuit boards are sound cards, video cards, a firewall card, a network card, etc. In such an arrangement of the PC, synchronization of one hardware device with one or more other hardware devices may be desirable. It would be an advantage in the art to provide an operating system for a PC that would synchronize hardware devices one with another without requiring expense hardware.